:root,
:host {
  --van-toast-max-width: 70%;
  --van-toast-font-size: var(--van-font-size-md);
  --van-toast-text-color: var(--van-white);
  --van-toast-loading-icon-color: var(--van-white);
  --van-toast-line-height: var(--van-line-height-md);
  --van-toast-radius: var(--van-radius-lg);
  --van-toast-background: rgba(0, 0, 0, 0.7);
  --van-toast-icon-size: 36px;
  --van-toast-text-min-width: 96px;
  --van-toast-text-padding: var(--van-padding-xs) var(--van-padding-sm);
  --van-toast-default-padding: var(--van-padding-md);
  --van-toast-default-width: 88px;
  --van-toast-default-min-height: 88px;
  --van-toast-position-top-distance: 20%;
  --van-toast-position-bottom-distance: 20%;
}

.van-toast {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: content-box;
  transition: all var(--van-duration-fast);

  // hack for avoid max-width when use left & fixed
  width: var(--van-toast-default-width);
  max-width: var(--van-toast-max-width);
  min-height: var(--van-toast-default-min-height);
  padding: var(--van-toast-default-padding);
  color: var(--van-toast-text-color);
  font-size: var(--van-toast-font-size);
  line-height: var(--van-toast-line-height);

  // allow newline character
  white-space: pre-wrap;
  word-break: break-all;
  text-align: center;
  background: var(--van-toast-background);
  border-radius: var(--van-toast-radius);

  &--break {
    &-normal {
      word-break: normal;
      word-wrap: normal;
    }

    &-word {
      word-break: normal;
      word-wrap: break-word;
    }
  }

  &--unclickable {
    // lock scroll
    overflow: hidden;
    cursor: not-allowed;

    // should not add pointer-events: none directly to body tag
    // that will cause unexpected tap-highlight-color in mobile safari
    * {
      pointer-events: none;
    }
  }

  &--text,
  &--html {
    width: fit-content;
    min-width: var(--van-toast-text-min-width);
    min-height: 0;
    padding: var(--van-toast-text-padding);

    .van-toast__text {
      margin-top: 0;
    }
  }

  &--top {
    top: var(--van-toast-position-top-distance);
  }

  &--bottom {
    top: auto;
    bottom: var(--van-toast-position-bottom-distance);
  }

  &__icon {
    font-size: var(--van-toast-icon-size);
  }

  &__loading {
    padding: var(--van-padding-base);
    color: var(--van-toast-loading-icon-color);
  }

  &__text {
    margin-top: var(--van-padding-xs);
  }
}
